using System;
using System.Threading.Tasks;
using JlPay.Sdk.Core;
using JlPay.Sdk.Models.Clearing;

namespace JlPay.Sdk.Services.Clearing
{
    /// <summary>
    /// 清算服务类
    /// </summary>
    public class ClearingService : BaseService
    {
        public ClearingService(Config config) : base(config)
        {
        }

        /// <summary>
        /// 查询提现结果
        /// </summary>
        /// <param name="request">请求对象</param>
        /// <returns>响应对象</returns>
        public async Task<WithdrawQueryResponse> QueryWithdrawAsync(WithdrawQueryRequest request)
        {
            return await PostAsync<WithdrawQueryRequest, WithdrawQueryResponse>(request, WithdrawQueryRequest.API_URI);
        }

        /// <summary>
        /// 申请提现
        /// </summary>
        /// <param name="request">请求对象</param>
        /// <returns>响应对象</returns>
        public async Task<WithdrawApplyResponse> ApplyWithdrawAsync(WithdrawApplyRequest request)
        {
            return await PostAsync<WithdrawApplyRequest, WithdrawApplyResponse>(request, WithdrawApplyRequest.API_URI);
        }

        /// <summary>
        /// 查询结算资金
        /// </summary>
        /// <param name="request">请求对象</param>
        /// <returns>响应对象</returns>
        public async Task<AccBalanceResponse> QueryAccBalanceAsync(AccBalanceRequest request)
        {
            return await PostAsync<AccBalanceRequest, AccBalanceResponse>(request, AccBalanceRequest.API_URI);
        }
    }
} 